import { http } from "@/utils/request";

export interface Banner {
  id: string;
  imgUrl: string;
  hrefUrl: string;
  type: string;
}

export const bannerApi = (): Promise<Banner[]> => {
  return http.get({
    url: "home/banner",
  });
};

export interface New {
  id: string;
  name: string;
  desc: string;
  price: string;
  picture: string;
  orderNum: number;
}

/**
 * @description: 获取新鲜好物
 * @param {*}
 * @return {*}
 */
export const findNewAPI = (): Promise<New[]> => {
  return http.get({
    url: "/home/new",
  });
};

/**
 * @description: 获取新鲜好物
 * @param {*}
 * @return {*}
 */
export const findHotAPI = (): Promise<New[]> => {
  return http.get({
    url: "/home/hot",
  });
};
